package com.instwall.callnumlistener.task;

import com.instwall.callbase.MConfig;
import com.instwall.callbase.thread.BasicTask;
import com.instwall.callbase.tool.LogUtil;
import com.instwall.callnumlistener.CallNumNotification;
import com.instwall.callnumserver.ICallNumListener;

public class AddClientTask extends BasicTask {

    private ICallNumListener listener;

    public AddClientTask(ICallNumListener listener) {
        this.listener = listener;
    }

    @Override
    public void doWork() {
        if (listener == null) {
            LogUtil.LogI(MConfig.TAG, "[AddClientTask][listener is null]");
            return;
        }
        CallNumNotification.mListeners.register(listener);
        LogUtil.LogI(MConfig.TAG, "[AddClientTask][register successfully]");
    }

    @Override
    public void cancel() {

    }

    @Override
    public int getPriority() {
        return 0;
    }
}
